'''
Created on Feb 18, 2013

@author: melegy
'''

import sys
sys.path.append("../")
import logging
import logging.handlers
import datetime
# from server.constants import packages_path

path = '/home/sshadmin/workspace/trilolo/' + 'logger/'
#===============================================================================
# this is the Main Logger
#===============================================================================
formatter = logging.Formatter('%(asctime)s %(message)s')
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('log')
efh = logging.handlers.RotatingFileHandler(path+'error_log.log', maxBytes=1000000000, backupCount=2)
dfh = logging.handlers.RotatingFileHandler(path+'debug_log.log', maxBytes=1000000000, backupCount=2)
ifh = logging.handlers.RotatingFileHandler(path+'info_log.log', maxBytes=1000000000, backupCount=2)
efh.setLevel(logging.ERROR)
dfh.setLevel(logging.DEBUG)
ifh.setLevel(logging.INFO)
efh.setFormatter(formatter)
dfh.setFormatter(formatter)
ifh.setFormatter(formatter)
log.addHandler(dfh)
log.addHandler(ifh)
log.addHandler(efh)